#include"Shm.hpp"
#include"Fifo.hpp"




int main()
{
    //服务器创建共享内存
   Shm shm(pathname, projid, CREATER);
   sleep(5);
   shm.Attribute();
   //创建命名管道
   NameFifo fifo(PATH, FILENAME);

   FileOper readerfile(PATH, FILENAME);
   readerfile.OpenForRead();
   char* mem = (char*)shm.VirtualAddr();
   while(true)
   {
      if(readerfile.Wait())
      {
          printf("%s\n", mem);
      }
      else
        break;
   }

   readerfile.Close();
    return 0;
}